# 构建的数据类型
import torch
# 移入绘图库
import matplotlib.pyplot as plt

noise = 0.2
# 簇类A(0.5,0.5)
points_a = torch.normal(0.5, noise, (20, 2))
# 簇类B(1.5,1.5)
points_b = torch.normal(1.5, noise, (20, 2))
# 簇类C(0.5,1.5)
points_c_x = torch.normal(0.5, noise, (20, 1))
points_c_y = torch.normal(1.5, noise, (20, 1))
points_c = torch.concatenate([points_c_x, points_c_y], dim=1)

plt.plot(points_a[:, 0], points_a[:, 1], 'ro')
plt.plot(points_b[:, 0], points_b[:, 1], 'bo')
plt.plot(points_c[:, 0], points_c[:, 1], 'go')
plt.show()
